package org.bluedream.core;

import org.bluedream.core.utils.SpringUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * 使用 ApplicationContextAware 工具类 有两种方式
 * 1. import导入@Import(SpringUtil.class)：未经测试
 * 2. @Bean注解引入：代码测试通过
 */
@SpringBootApplication
@MapperScan("org.bluedream.core.module.**.dao")
@EnableTransactionManagement
//@Import(SpringUtil.class)
public class Application {

    @Bean
    public SpringUtil getSpringUtil(){
        return new SpringUtil();
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class);
    }
}
